﻿@using EC.Entity.Response.BankCard
@using EC.Entity.Enum
@using EC.Util

@model EC.Entity.PagedList<StockCardQueryResponse>
<div class="data-body data-scroll">
    <div class="data-view">
        <div class="data-div-view table-responsive">
            <table class="table table-hover table-striped table-bordered">
                <thead>
                    <tr>
                        <th class="t_l">银行名称</th>
                        <th class="t_l wd100">用户名</th>
                        <th class="t_l wd150">银行卡号</th>
                        <th class="t_c wd75">类型</th>
                        <th class="t_c wd75">是否冻结</th>
                        <th class="t_c wd75">状态</th>
                        <th class="t_c wd130">创建时间</th>
                        <th width="110">操作</th>
                    </tr>
                </thead>
                <tbody>
                    @if (Model != null && Model.TData != null && Model.TData.Any())
                    {
                        foreach (var item in (IEnumerable<StockCardQueryResponse>)Model.TData)
                        {
                            <tr>
                                <td class="t_l">@(item.BankName)</td>
                                <td class="t_l wd100">@(item.BankCardName)</td>
                                <td class="t_l wd150">@(item.BankCardNumber)</td>
                                <td class="t_c wd75">@(EnumUtil.GetDescription(typeof(CardType), item.CardType))</td>
                                <td class="t_c wd75">@(EnumUtil.GetDescription(typeof(BankCardFrozen), item.Frozen))</td>
                                <td class="t_c wd75">@(EnumUtil.GetDescription(typeof(BankCardStatus), item.Status))</td>
                                <td class="t_l wd130">@(item.CreatedDate.ToString("yyyy-MM-dd HH:mm:ss"))</td>
                                <td width="110">
                                    @if (item.Status == (sbyte)BankCardStatus.启用 || item.Status == (sbyte)BankCardStatus.禁用)
                                    {
                                        <a class="btn btn-danger btn-xs" data-confirm="确定要收回该银行卡？？" data-succesFun="doSearch()" data-href="/BankCard/Auth?id=@(item.Id)&status=@((sbyte)BankCardStatus.未授权)">收回</a>
                                    }
                                    else
                                    {
                                        <a class="btn btn-danger btn-xs" data-confirm="确定要给予该银行卡？？" data-succesFun="doSearch()" data-href="/BankCard/Auth?id=@(item.Id)&status=@((sbyte)BankCardStatus.启用)">给予</a>
                                    }
                                    @if (item.Status == (sbyte)BankCardStatus.未授权)
                                    {
                                        <button type="button" class="btn btn-default btn-xs" data-modal="/BankCard/StockCardAddOrEdit/@(item.Id)" data-title="编辑" data-width="500" data-height="450">
                                            <span class="glyphicon glyphicon-edit"></span> 编辑
                                        </button>
                                    }
                                </td>
                            </tr>
                        }
                    }
                    else
                    {
                        <tr>
                            <td colspan="8" class="t_c">暂无记录</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- 必要的分页参数设置 -->
<input type="hidden" id="TotalCount" value="@(Model != null ? Model.TotalCount : 0)" />